var querystring = require('querystring');
var http = require('http');
var fs = require('fs');

function PostCode() {
  // 这里是发送的，要插入的新数据
  var post_data = querystring.stringify({
    "guid":'6709a9e4-b92c-488e-940c-ddc5f3dbe059',
    "name":'MM',
    "gender":'F',
    "age":26,
    "describe":'this is a good person'
  });
 
  var post_options = {
      host: 'localhost',
      port: '3006',
      path: '/insertPersonalData',
      method: 'POST',
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Content-Length': Buffer.byteLength(post_data)
      }
  };
 
  var post_req = http.request(post_options, function(res) {
      res.setEncoding('utf8');
      res.on('data', function (chunk) {
          console.log('Response: ' + chunk);
      });
  });
 
  post_req.write(post_data);
  post_req.end();
 
}

PostCode()